package com.shihb.behavioralpatterns.strategypattern;/**
 *Description:策略模式
 *Version:1.0.0
 *@author shihb
 *@date 2020/4/21 11:25
 */
public class Client {

  public static void main(String[] args) {
    ToyDuck toyDuck = new ToyDuck();
    WildDuck wildDuck = new WildDuck();

    toyDuck.fly();
    toyDuck.swim();
    wildDuck.fly();
    wildDuck.swim();
    toyDuck.setSwimStrategy(new CanSwim());
    toyDuck.swim();
  }
}
